package com.kfm.jdbc.day0404.thread;

public class Demo01 {

    public static void main(String[] args) {
        // 创建一个 Runnable 实现类的对象, 传递给 Thread 类的构造器
        MyRunnable myRunnable = new MyRunnable();

        Thread t1 = new Thread(myRunnable, "线程1");
        Thread t2 = new Thread(myRunnable, "线程2");
        t1.start();
        t2.start();

        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName() + i);
        }
    }
}
